-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove BaseHTTPMiddlewares , Ensure origin host is used in STAC links #190
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked through the timeout and exception handling changes, and I think we're good. Just one quick question.
And I'm less familiar with the Brotli middleware, but I think that looks OK too.
pctiler/pctiler/main.py
Outdated
return await handle_exceptions(request, call_next) | ||
|
||
|
||
app.add_exception_handler(Exception, http_exception_handler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you confirm that if you make an invalid POST request (like bad data) we still get the nice error message? I couldn't quickly confirm what the behavior of app.add_exception_handler
is with Exception subclasses / order. I see that we reraise HTTPException
in our handler, and just want to make sure FastAPI's still handles it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also taking a look at this. |
You will need #195 to fix the CI build |
Description
Removing BaseHTTPMiddleware to improve performance. Re-implementation of timeout middleware and error handling middleware replaced by registering exception handlers with the app. Reimplementation of trace middleware by calling the tracing function directly instead of using a BaseHTTPMiddleware .
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
I ran ./scripts/test
Checklist:
Please delete options that are not relevant.